/*

PhyML:  a program that  computes maximum likelihood phylogenies from
DNA or AA homologous sequences.

Copyright (C) Stephane Guindon. Oct 2003 onward.

All parts of the source except where indicated are distributed under
the GNU public licence. See http://www.opensource.org for details.

*/

#ifndef NUMERIC_H
#define NUMERIC_H

double *Covariance_Matrix(arbre *tree);
double *Hessian(arbre *tree);
void Recurr_Hessian(node *a, node *b, int plus_minus, double eps, double *res, arbre *tree);
double stdnormal_inv(double p);
double Uni();
int    Rand_Int(int min, int max);
double Ahrensdietergamma(double alpha);
double Rgamma(double shape, double scale);
double Rexp(double lambda);
double Bico(int n, int k);
double Factln(int n);
double Gammln(double xx);
double Pbinom(int N, int ni, double p);
double LnGamma (double alpha);
double IncompleteGamma(double x, double alpha, double ln_gamma_alpha);
double PointChi2 (double prob, double v);
double Bivariate_Normal_Density(double x, double y, double mux, double muy, double sdx, double sdy, double rho);
double PointNormal (double prob);
int    DiscreteGamma (double freqK[], double rK[],double alfa, double beta, int K, int median);
double CDF_Normal(double x, double mean, double var);
double Dnorm_Moments(double x, double mean, double var);
double Dnorm(double x, double mean, double sd);
double CDF_Gamma(double x, double shape, double scale);
double Dgamma_Moments(double x, double mean, double var);
double Dgamma(double x, double shape, double scale);
double LnFact(int n);
int    Choose(int n, int k);
double CDF_Pois(double x, double param);
double Dexp(double x, double param);
double Dpois(double x, double param);
double Rand_Normal_Deviate(double mean, double sd);
double Rnorm(double mean, double sd);
double *Rnorm_Multid(double *mu, double *cov, int dim);
double Rnorm_Trunc(double mean, double sd, double min, double max);
double *Rnorm_Multid_Trunc(double *mean, double *cov, double *min, double *max, int dim);


#endif NUMERIC_H
